package de.ergin.fuhrparkverwaltung;

import de.ergin.fuhrparkverwaltung.R;
import de.ergin.fuhrparkverwaltung.activities.FahrzeugAnlegen;
import de.ergin.fuhrparkverwaltung.activities.FahrzeugAuswaehlen;
import de.ergin.fuhrparkverwaltung.activities.FahrzeugWartungen;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.View;

public class StartActivity extends Activity {

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.startactivity);
	}

	public void onButtonClick(View view) {
		switch (view.getId()) {
		case R.id.btn_CreateCar:
			startActivity(new Intent(this, FahrzeugAnlegen.class));
			break;
		case R.id.btn_SelectCar:
			startActivity(new Intent(this, FahrzeugAuswaehlen.class));
			break;
		case R.id.btn_NextMaintenance:
			startActivity(new Intent(this, FahrzeugWartungen.class));
			break;

		}
	}

}

// try {
//
// File sd = Environment.getExternalStorageDirectory();
// File data = Environment.getDataDirectory();
//
// if (sd.canWrite()) {
// String currentDBPath =
// "//data//de.ergin.fuhparkv2//databases//Fuhrpark.db";
// String backupDBPath = "Test//Fuhrpark.db";
// File currentDB = new File(data, currentDBPath);
// File backupDB = new File(sd, backupDBPath);
//
// if (currentDB.exists()) {
// FileChannel src = new FileInputStream(currentDB)
// .getChannel();
// FileChannel dst = new FileOutputStream(backupDB)
// .getChannel();
// dst.transferFrom(src, 0, src.size());
// src.close();
// dst.close();
// }
// Toast.makeText(this, "Data Save", Toast.LENGTH_SHORT)
// .show();
// }
// } catch (Exception e) {
// Toast.makeText(this, "Data dont Save", Toast.LENGTH_SHORT)
// .show();
// }
